<?php
	$tg=time();
	$tgout=900;
	$tgnew=$tg - $tgout;
	$conn=mysql_connect("localhost","root","vertrigo") or die("Không thể kết nối!");
	mysql_select_db("webqtd",$conn);
	$sql="insert into useronline(tgtmp,ip,local) values('$tg','$REMOTE_ADDR','$PHP_SELF')";
	$query=mysql_query($sql);
	$sql="delete from useronline where tgtmp < $tgnew";
	$query=mysql_query($sql);
	$sql="SELECT DISTINCT ip FROM useronline WHERE file='$PHP_SELF'";
	$query=mysql_query($sql);
	$user = mysql_num_rows($query);
	echo "user online :$user";
	?>